package com.caseProject.puremvc.model.vo
{
	public class PartitionVO
	{
		private var _id:int;
		private var _posX:Number;
		private var _posY:Number;
		private var _elements:Vector.<ElementVO>;
		
		public function PartitionVO()
		{
			this._elements = new Vector.<ElementVO>;
		}

		public function get posY():Number
		{
			return _posY;
		}

		public function set posY(value:Number):void
		{
			_posY = value;
		}

		public function get posX():Number
		{
			return _posX;
		}

		public function set posX(value:Number):void
		{
			_posX = value;
		}

		public function get id():int
		{
			return _id;
		}

		public function set id(value:int):void
		{
			_id = value;
		}

		public function get elements():Vector.<ElementVO>
		{
			return _elements;
		}
		
		public function addElements(value:Vector.<ElementVO>):void
		{
			this._elements = value;
		}

		public function setElement(value:ElementVO):void
		{
			_elements.push(value);
		}
		
		public function toString ():String
		{
			var tag:String = '<partition id="' + this.id + 
							 '" posX="' + this.posX + 
							 '" posY="' + this.posY + '">'+
							 this.elementsTag() 
							 + '</partition>';
			return tag;
		}
		
		private function elementsTag():String
		{
			var tag:String;
			
			for (var i:int = 0; i < this.elements.length; i++)
			{
				tag += '\t'+ this.elements[i].toString() + '\n';
			}
			return tag;
		}		
	}
}